treelistmodel: Improve naming a bit
authorBenjamin Otte <otte@redhat.com>
Tue, 18 Sep 2018 05:50:33 +0000 (07:50 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 18 Sep 2018 06:03:03 +0000 (08:03 +0200)
The complexity with model items vs row items is really confusing. Add to
that treelistmodel position vs child model position vs parent position,
and you're so confused, even the best naming can't help.

And once you're there, consider passthrough vs non-passthrough...

docs/reference/gtk/gtk4-sections.txt
gtk/gtktreelistmodel.c
gtk/gtktreelistmodel.h
gtk/inspector/object-tree.c

index ea0709487e58e82d0f4a91382c86b251882e15e8..dd88c0206fac133f3641a03c9040cf87bab4df58 100644 (file)
@@ -3383,7 +3383,7 @@ gtk_tree_list_model_get_model
 gtk_tree_list_model_get_passthrough
 gtk_tree_list_model_set_autoexpand
 gtk_tree_list_model_get_autoexpand
-gtk_tree_list_model_get_child
+gtk_tree_list_model_get_child_row
 gtk_tree_list_model_get_row
 
 <SUBSECTION>
@@ -3395,7 +3395,7 @@ gtk_tree_list_row_get_position
 gtk_tree_list_row_get_depth
 gtk_tree_list_row_get_children
 gtk_tree_list_row_get_parent
-gtk_tree_list_row_get_child
+gtk_tree_list_row_get_child_row
 
 <SUBSECTION Standard>
 GTK_TREE_LIST_MODEL
index c619347e5404fdf2813e5c3d638ef9d514eed521..3848e12e93079b314a804699f98b8ba08bd7e3e3 100644 (file)
@@ -881,7 +881,7 @@ gtk_tree_list_model_get_autoexpand (GtkTreeListModel *self)
  * If @self is set to not be passthrough, this function is equivalent
  * to calling g_list_model_get_item().
  *
- * Do not confuse this function with gtk_tree_list_model_get_child().
+ * Do not confuse this function with gtk_tree_list_model_get_child_row().
  *
  * Returns: (nullable) (transfer full): The row item 
  **/
@@ -901,7 +901,7 @@ gtk_tree_list_model_get_row (GtkTreeListModel *self,
 }
 
 /**
- * gtk_tree_list_model_get_child:
+ * gtk_tree_list_model_get_child_row:
  * @self: a #GtkTreeListModel
  * @position: position of the child to get
  *
@@ -916,8 +916,8 @@ gtk_tree_list_model_get_row (GtkTreeListModel *self,
  * Returns: (nullable) (transfer full): the child in @position
  **/
 GtkTreeListRow *
-gtk_tree_list_model_get_child (GtkTreeListModel *self,
-                               guint             position)
+gtk_tree_list_model_get_child_row (GtkTreeListModel *self,
+                                   guint             position)
 {
   TreeNode *child;
 
@@ -1345,7 +1345,7 @@ gtk_tree_list_row_get_parent (GtkTreeListRow *self)
 }
 
 /**
- * gtk_tree_list_row_get_child:
+ * gtk_tree_list_row_get_child_row:
  * @self: a #GtkTreeListRow
  * @position: position of the child to get
  *
@@ -1355,8 +1355,8 @@ gtk_tree_list_row_get_parent (GtkTreeListRow *self)
  * Returns: (nullable) (transfer full): the child in @position
  **/
 GtkTreeListRow *
-gtk_tree_list_row_get_child (GtkTreeListRow *self,
-                             guint           position)
+gtk_tree_list_row_get_child_row (GtkTreeListRow *self,
+                                 guint           position)
 {
   TreeNode *child;
 
index 40c4d572622b9185625cc162099dbb3ff3286b57..df41500ecc3874ec0167487ccb62a44b1ede8915 100644 (file)
@@ -76,7 +76,7 @@ GDK_AVAILABLE_IN_ALL
 gboolean                gtk_tree_list_model_get_autoexpand      (GtkTreeListModel       *self);
 
 GDK_AVAILABLE_IN_ALL
-GtkTreeListRow *        gtk_tree_list_model_get_child           (GtkTreeListModel       *self,
+GtkTreeListRow *        gtk_tree_list_model_get_child_row       (GtkTreeListModel       *self,
                                                                  guint                   position);
 GDK_AVAILABLE_IN_ALL
 GtkTreeListRow *        gtk_tree_list_model_get_row             (GtkTreeListModel       *self,
@@ -100,7 +100,7 @@ GListModel *            gtk_tree_list_row_get_children          (GtkTreeListRow
 GDK_AVAILABLE_IN_ALL
 GtkTreeListRow *        gtk_tree_list_row_get_parent            (GtkTreeListRow         *self);
 GDK_AVAILABLE_IN_ALL
-GtkTreeListRow *        gtk_tree_list_row_get_child             (GtkTreeListRow         *self,
+GtkTreeListRow *        gtk_tree_list_row_get_child_row         (GtkTreeListRow         *self,
                                                                  guint                   position);
 
 
index adf50f1347c0b6b85b946028ea9852c6d4674b99..ff2d0d060e42c09988251236e33bec4b9b9f6520 100644 (file)
@@ -1251,13 +1251,13 @@ find_and_expand_object (GtkTreeListModel *model,
 
       gtk_tree_list_row_set_expanded (parent_row, TRUE);
       pos = model_get_item_index (gtk_tree_list_row_get_children (parent_row), object);
-      result = gtk_tree_list_row_get_child (parent_row, pos);
+      result = gtk_tree_list_row_get_child_row (parent_row, pos);
       g_object_unref (parent_row);
     }
   else
     {
       pos = model_get_item_index (gtk_tree_list_model_get_model (model), object);
-      result = gtk_tree_list_model_get_child (model, pos);
+      result = gtk_tree_list_model_get_child_row (model, pos);
     }
   
   return result;